package demo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-03-22
 * Time: 9:10
 */
interface IFly{
    void fly();
}
interface IRunning{
    void run();
}
interface ISwimming{
    void swim();
}
class Animin{
    private String name;
    private int age;

    public Animin(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void eat(){
        System.out.println(name+"吃饭！");
    }
}
class Dog extends Animin implements IRunning,ISwimming{

    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void eat(){
        System.out.println(this.getName()+"吃饭！");
    }
    @Override
    public void run() {
        System.out.println(this.getName()+"在游泳");
    }
    @Override
    public void swim() {
        System.out.println(this.getName()+"在游泳");
    }

}
public class Test {
    public static void map(Animin animin){
        animin.eat();
    }
    public static void main(String[] args) {
        map(new Dog("小花",1));
    }
}
